﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HCQ2_Model.Pay
{
    /// <summary>
    /// 父订单列表
    /// </summary>
    public class ParentOrderListModel : IParentOrderID,IOrderState
    {
        /// <summary>
        /// 父单号
        /// </summary>
        public string ParentOrderCode { get; set; }
        /// <summary>
        /// 订单状态;1(等待买家付款)、(2买家已付款)、4(交易成功)、5(交易关闭)、6(退款中)
        /// </summary>
        public int? OrderState { get; set; }
        
        /// <summary>
        /// 实付款
        /// </summary>
        public decimal? PaymentAmountTotal { get; set; }
        /// <summary>
        /// 父单号下面子订单商品信息
        /// </summary>
        public List<ParentOrderListModelChild> ChildOrders { get; set; }

        #region 添加需求《VLions需求规格_度度圈接口需求_订单及购物车-202100909.docx》的相关内容
        /// <summary>
        /// 收货人姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 收货人电话
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 所在地区
        /// </summary>
        public string Area { get; set; }

        /// <summary>
        /// 详细地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 桌号
        /// </summary>
        public string TableNum { get; set; }

        /// <summary>
        /// 包装类别，0=堂食，1=打包
        /// </summary>
        public int PackType { get; set; }
        #endregion

        /// <summary>
        /// 下单时间
        /// <br/>2021-9-23：禅道174号需求添加
        /// </summary>
        public string OrderCreateTime { get; set; }


        /// <summary>
        /// 备货/物流状态
        /// </summary>
        public int StorageStatus { get; set; }

        /// <summary>
        /// 距离，仅供参考，不满足自行通过 订单和店铺的“经度”“纬度”计算距离
        /// </summary>
        public double Distance { get; set; }

        /// <summary>
        /// 订单》经度
        /// </summary>
        public decimal? GpsX { get; set; }

        /// <summary>
        /// 订单》纬度
        /// </summary>
        public decimal? GpsY { get; set; }

        /// <summary>
        /// 店铺》经度
        /// </summary>
        public decimal? StoreGpsX { get; set; }

        /// <summary>
        /// 店铺》纬度
        /// </summary>
        public decimal? StoreGpsY { get; set; } 

        /// <summary>
        /// 接单人姓名
        /// </summary>
        public string OrderReceivingUserName { get; set; }

        /// <summary>
        /// 接单人电话
        /// </summary>
        public string OrderReceivingPhone { get; set; }

        /// <summary>
        /// 接单人头像
        /// </summary>
        public string OrderReceivingUserPhoto { get; set; }
    }

    /// <summary>
    /// 父单号下面子订单商品信息
    /// </summary>
    public class ParentOrderListModelChild : IOrderID, IPayCommodityInfo, ISupplyType
    {
         /// <summary>
         /// 子单号
         /// </summary>
        public string OrderCode { get; set; }
        /// <summary>
        /// 购买商品ID
        /// </summary>
        public int? CommodityId { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string FileName { get; set; }
        /// <summary>
        /// 简介
        /// </summary>
        public string FileNote { get; set; }
        /// <summary>
        /// 商品图片地址
        /// </summary>
        public string FileImgUrl { get; set; }
        /// <summary>
        /// 商品来源；0个人、1自营
        /// </summary>
        public int? SupplyType { get; set; }
        /// <summary>
        /// 购买商品期限；1（一个月）、3（三个月）、6（六个月）12（一年）
        /// </summary>
        public int? PurchasePeriod { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        public decimal? PaymentAmount { get; set; }


        #region 添加需求《VLions需求规格_度度圈接口需求_订单及购物车-202100909.docx》的相关内容

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 店铺ID
        /// </summary>
        public int StoreID { get; set; }

        /// <summary>
        /// 店铺名称
        /// </summary>
        public string StoreName { get; set; }

        /// <summary>
        /// 备货状态
        /// </summary>
        public int StorageStatus { get; set; }

        #endregion

        /// <summary>
        /// 规格列表
        /// <br/>
        /// 2021-9-16：禅道174号需求添加
        /// </summary>
        public List<SpecParamModel> Specs { get; set; } = new List<SpecParamModel>();


        /// <summary>
        /// 商品单价
        /// </summary>
        public decimal? UnitPrice { get; set; }
    }
}
